package com.demo.onvif.utils;

import java.net.ConnectException;
import java.util.List;

import javax.xml.soap.SOAPException;


import de.onvif.soap.OnvifDevice;
import org.onvif.ver10.schema.Profile;

public class OnvifTest {
    public static void main(String[] args) {
        try {
            OnvifDevice nvt = new OnvifDevice("10.11.100.254:80", "admin", "master008");
            List<Profile> profiles = nvt.getDevices().getProfiles();
            System.out.println("===========================");
            profiles.forEach(System.out::println);


            //String profileToken = profiles.get(0).getToken();
            //System.out.println("Snapshot URI: "+nvt.getMedia().getSnapshotUri(profileToken));
        }
        catch (ConnectException e) {
            System.err.println("Could not connect to NVT.");
        }
        catch (SOAPException e) {
            e.printStackTrace();
        }
    }
}